home *** CD-ROM | disk | FTP | other *** search
/ ETO Development Tools 4 / ETO Development Tools 4.iso / Essentials / MacApp Documentation / MacApp.TECH$ Archives / 1990 / Feb 90 / MacApp.Tech$ 2⁄23⁄90 / 0731-Re Persistent Observ-Feb90 < prev    next >
Encoding:
Text File  |  1991-03-06  |  1.2 KB  |  39 lines  |  [TEXT/GEOL]

  1. Item forwarded  by  A33          to A34
  2.  
  3. Item    1972390                         20-Feb-90        23:42PST
  4.  
  5. From:   MUYSVASOVIC                     ACE - Jean-Denis Muys-Vasovic
  6.  
  7. To:     ALGER                           Alger, Jeff,VCA
  8.  
  9. cc:     MACAPP.TECH$                    MacApp Technical
  10.  
  11. Sub:    Re: Persistent Observations
  12.  
  13. Jeff,
  14.  
  15. Your "owned" seems good to me, but how would you handle the situation for
  16. dynamically variable fields, a la TList? And how would you solve the following
  17. quite common situation, say in a MacDraw-like program:
  18.  
  19. User clicks inside the view to create a new shape. A new TCommand is created.
  20. This TCommand will create the new TShape, and add it to the Document's shape
  21. list (a TList). Who is the owner of the shape? Now the user might choose to
  22. undo, in which case the shape must be freed. By whom? Usually, this problem is
  23. handled by the TCommand in the free method:
  24.  
  25. TSketcher.Free; OVERRIDE;
  26. BEGIN
  27. IF NOT fCommandDone THEN fNewShape.Free;
  28. INHERITED Free;
  29. END;
  30.  
  31. How would you adapt this scheme to your ownership assertion? I feel that
  32. ownership is not easy to decide. Again, the real solution seems to be automatic
  33. garbage collection.
  34.  
  35. Regards.
  36.  
  37. Jean-Denis
  38.  
  39.